<?php
header('Content-Type:text/html;charset=utf-8');
require_once('include/config.php');
require_once('include/wp-db.php');
require_once('include/utils.php');

$time=time();

$d=intval($_REQUEST['d']);

$sql_cp="select * from miao_cp where id='$d' and flag=1 ";
$row_cp=$wpdb->get_row($sql_cp);
if($row_cp!=NULL)
{
	$title=$row_cp->title;
	$showsubtitle=$row_cp->subtitle;
	$markprice=$row_cp->markprice;
	$miaoprice_n=$row_cp->miaoprice;
	$begintime=$row_cp->begintime;
	$endtime=$row_cp->endtime;
	$nums=$row_cp->nums;
	$str_begintime=$row_cp->str_begintime;
	$str_endtime=$row_cp->str_endtime;
	
	$showimgpath=$row_cp->imgpath;
	$showcontent=$row_cp->content;
	
	$month=date('m',$str_begintime);
	$day=date('d',$str_begintime);
	$hour=date('H',$str_begintime);
	
}
else
{
	ShowMsg('对不起，没有查到你要的产品','index.php');	
	exit;
}


?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>汉庭海友客栈</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery-1.6.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
	$('.gtl').click(function(){
		$("#login").before("<div id='exposeMask' style='*height:"+$("body").height()+"px'></div>");
		$("#login").show();
    });
	$('.close').click(function(){
		$("#exposeMask").remove();
		$("#login").hide();
    });
});
</script>
</head>
<body>
<div id="header">
	<div class="logo"><a href="index.php"></a></div>
	<div class="menu">
		<ul>
			<li><a href="./"><img src="images/menu_1.png" alt="首页" /></a></li>
			<li><a href="list.php"><img src="images/menu_2_.png" alt="今日秒杀" /></a></li>
			<li><a href="next.php"><img src="images/menu_3.png" alt="下期预告" /></a></li>
			<li><a href="photo.php"><img src="images/menu_4.png" alt="客栈相册" /></a></li>
			<li><a href="qa.php"><img src="images/menu_5.png" alt="常见问题" /></a></li>
		</ul>
	</div>
	<div class="banner">
		<div class="nav">
			<ul>
				<li><a class="gtl"><img src="images/nav_login.png" /></a></li>
				<li><a href="./h/index.html"><img src="images/nav_hello.png" /></a></li>
				<li><a href="explain.php"><img src="images/nav_explain.png" /></a></li>
				<li><a href="http://www.htinns.com/hanting/KZDefault.aspx"  target="_blank"><img src="images/nav_website.png" /></a></li>
			</ul>
		</div>
		<?php include('share.php');?>
	</div>
</div>
<div id="main" class="fix">
	<?php include('left.php');?>
	<div class="right">
		<div style="padding:30px 0 0 40px">
			<h2><?php echo $title?></h2>
			<div class="deal-intro">
				<div class="pics"><img src="upload/hotel/<?php echo $showimgpath;?>" /></div>
				<div class="side">
					<table cellpadding="0" cellspacing="0">
						<tr>
							<th>市场价：</th>
							<td><em>￥<?php  echo $markprice;?></em></td>
							<th>秒杀价：</th>
							<td><b>￥<?php echo $miaoprice_n;?></b></td>
						</tr>
					</table>
                    
                    <?php if($time>=$str_endtime)
					{
					?>
                    <p><span>秒杀已经结束</span></p>
                    
                    <?php	
						
					}
					else
					{
						
						?>
                        
                       <p><span>开始日期&nbsp;&nbsp;</span><strong><?php echo $month?></strong><span>月</span><strong><?php echo $day?></strong><span>日</span><strong><?php echo $hour?></strong><span>时</span></p>
                    
                    	<p><span>秒杀数量：&nbsp;&nbsp;<?php echo $nums?> 个</span></p>
                         
                        <?php
						
					}
					
					?>
					
                        
                        
                        
				</div>
				<div class="txt">
					<strong><?php echo $showsubtitle?></strong><br />
					<?php echo $showcontent;?>
				</div>
			</div>
		</div>
	</div>
</div>
<?php include('footer.php');?>
<?php include('logintemplate.php');?>
</body>
</html>
